Release 10.1A: OpenEdge Development:
ProDataSets
The RESTART-ROWID attribute
The second new attribute is
RESTART-ROWID. This is also of data-typeROWIDand is supported for each buffer in the Data-Source.RESTART-ROWIDis accessed through the Data-Source handle by specifying the database buffer sequence number or buffer name, because in the event of a join, there may be multiple database buffers for a single Data-Source. For example:
The
buffer-sequence-numberis anINTEGERthat represents the sequence number of the desired buffer within the Data-Sources buffer list. Thebuffer-nameis aCHARACTERexpression that evaluates to the name of a buffer in the Data-Source object. If nobuffer-sequence-numberorbuffer-nameis given, the attribute defaults to the first (or only) buffer in the Data-Source.The
RESTART-ROWIDattribute is read-write. UnlikeNEXT-ROWID,RESTART-ROWIDis normally set by application code. The default is the Progress Unknown value (?). If the application setsRESTART-ROWID, any subsequentFILLusing that Data-Source opens the Data-Source’s query, and then tries to reposition the query to the RowID given.When the
FILLmethod is executed on a Data-Source with one buffer, Progress opens the Data-Source query. Then it checks to see if theRESTART-ROWIDhas a value other than the Unknown value (?). If it does, Progress tries to reposition the Data-Source query to that RowID. If the reposition is successful, Progress proceeds with theFILLoperation. If the reposition is not successful, Progress puts out an error message, sets theRESTART-ROWIDto the Unknown value (?), and continues theFILLfrom the top of the query at the current level. If theRESTART-ROWIDis the Unknown value (?), Progress proceeds with theFILLoperation without repositioning the query.When the
FILLmethod is executed on a Data-Source with more than one buffer, Progress opens the Data-Source query. Then it checks theRESTART-ROWIDs beginning with the top-most level of the join (the buffer whose sequence number is 1) and working downward. If the top-mostRESTART-ROWIDis the Unknown value (?), Progress proceeds with theFILLoperation without repositioning the query.If the top-most
RESTART-ROWIDis not the Unknown value (?), Progress continues to examine theRESTART-ROWIDs in sequence order. As soon as it finds aRESTART-ROWIDequal to the Unknown value (?), it stops examiningRESTART-ROWIDs and tries to reposition the query with theRowIDsthat it has. If the reposition is successful, Progress proceeds with theFILLoperation. If the reposition is not successful, Progress puts out an error message, sets theRESTART-ROWIDto the Unknown value (?), and continues theFILLfrom the top of the query at the current level.If for any reason the specified
RESTART-ROWIDis not valid (possibly because it belongs to a child of a different parent than the current one), theRowIDis ignored and theFILLstarts back at the first row satisfying the selection criteria or the Data-Relation. An error message results but theFILLcontinues. You can putNO-ERRORon theFILLto suppress the message, or allow it to go harmlessly into the server-side error log.The
NEXT-ROWIDattribute is set by Progress for each Data-Source at the end of aFILLto signal to the application what the RowID of the next row to be retrieved at that level is. It is the responsibility of the application code to store this value and send it to the client, and then for the client to pass it back as anINPUTparameter to the nextFILLrequest. The server code supporting theFILLrequest can then setRESTART-ROWIDat that level and do the nextFILL.These two separate attributes are required to avoid situations where there could be conflicts between Progress setting the attribute value and the application setting the attribute value.
NEXT-ROWIDis set by Progress to provide information to the application.RESTART-ROWIDis never set by Progress. If the user setsRESTART-ROWID, it is an instruction to Progress to start the nextFILLat that level.Neither attribute is marshalled between server and client.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |